<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>双子星</title>
    <style>
        html,
        body {
            margin: 0px;
            padding: 0px;
            height: 100%;
            width: 100%;
            background-color: black;
            font-size: 0px;
            line-height: 0px;
            color: rgb(115, 115, 209)
        }
    </style>
</head>

<body>
    <canvas id="canvas"></canvas>
</body>
<script>

    //画布
    let height = document.body.offsetHeight;
    let width = document.body.offsetWidth;
    var canvas = document.getElementById("canvas");
    var ctx = canvas.getContext("2d");
    //设置画布宽高
    canvas.height = height;
    canvas.width = width;
    let center = {
        x: Math.floor(width / 2),
        y: Math.floor(height / 2)
    }
    let stars = [
        {//太阳
            mass: 500,//质量
            radius: 5,
            speed: {//速度
                x: -2,
                y: 0
            },
            coordinate: {//位置
                x:center.x+50, y: center.y+150
            }
        },
        {//太阳
            mass: 500,//质量
            radius: 5,
            speed: {//速度
                x: 2,
                y: 0
            },
            coordinate: {//位置
                x: center.x-50,y:center.y-150
            }
        }

    ];
</script>
<script src="./gravity.js"></script>

</html>